<?php

/**
 * 网站首页入口
 *
 * @author 苏宁 <snsnsky@gmail.com>
 *
 * $Id$
 */

define('NO_SESSION', true);
require_once('./common.inc.php');

class index extends lib\core\Action
{
    public function doDefault()
    {
        $smarty = $this->app->page();

        $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
        if (preg_match('/iphone|android|ipad/', $agent)) {
            $this->app->redirect('http://m.' . CURRENT_HOST . '/');
            exit;
        }

        $smarty->output();
    }
}

$app->run();
